package com.mtiiot.fstcpserver.fastdfs.core;

import java.util.Date;

public class StructStorageStat extends StructBase
{
  protected static final int FIELD_INDEX_STATUS = 0;
  protected static final int FIELD_INDEX_ID = 1;
  protected static final int FIELD_INDEX_IP_ADDR = 2;
  protected static final int FIELD_INDEX_DOMAIN_NAME = 3;
  protected static final int FIELD_INDEX_SRC_IP_ADDR = 4;
  protected static final int FIELD_INDEX_VERSION = 5;
  protected static final int FIELD_INDEX_JOIN_TIME = 6;
  protected static final int FIELD_INDEX_UP_TIME = 7;
  protected static final int FIELD_INDEX_TOTAL_MB = 8;
  protected static final int FIELD_INDEX_FREE_MB = 9;
  protected static final int FIELD_INDEX_UPLOAD_PRIORITY = 10;
  protected static final int FIELD_INDEX_STORE_PATH_COUNT = 11;
  protected static final int FIELD_INDEX_SUBDIR_COUNT_PER_PATH = 12;
  protected static final int FIELD_INDEX_CURRENT_WRITE_PATH = 13;
  protected static final int FIELD_INDEX_STORAGE_PORT = 14;
  protected static final int FIELD_INDEX_STORAGE_HTTP_PORT = 15;
  protected static final int FIELD_INDEX_CONNECTION_ALLOC_COUNT = 16;
  protected static final int FIELD_INDEX_CONNECTION_CURRENT_COUNT = 17;
  protected static final int FIELD_INDEX_CONNECTION_MAX_COUNT = 18;
  protected static final int FIELD_INDEX_TOTAL_UPLOAD_COUNT = 19;
  protected static final int FIELD_INDEX_SUCCESS_UPLOAD_COUNT = 20;
  protected static final int FIELD_INDEX_TOTAL_APPEND_COUNT = 21;
  protected static final int FIELD_INDEX_SUCCESS_APPEND_COUNT = 22;
  protected static final int FIELD_INDEX_TOTAL_MODIFY_COUNT = 23;
  protected static final int FIELD_INDEX_SUCCESS_MODIFY_COUNT = 24;
  protected static final int FIELD_INDEX_TOTAL_TRUNCATE_COUNT = 25;
  protected static final int FIELD_INDEX_SUCCESS_TRUNCATE_COUNT = 26;
  protected static final int FIELD_INDEX_TOTAL_SET_META_COUNT = 27;
  protected static final int FIELD_INDEX_SUCCESS_SET_META_COUNT = 28;
  protected static final int FIELD_INDEX_TOTAL_DELETE_COUNT = 29;
  protected static final int FIELD_INDEX_SUCCESS_DELETE_COUNT = 30;
  protected static final int FIELD_INDEX_TOTAL_DOWNLOAD_COUNT = 31;
  protected static final int FIELD_INDEX_SUCCESS_DOWNLOAD_COUNT = 32;
  protected static final int FIELD_INDEX_TOTAL_GET_META_COUNT = 33;
  protected static final int FIELD_INDEX_SUCCESS_GET_META_COUNT = 34;
  protected static final int FIELD_INDEX_TOTAL_CREATE_LINK_COUNT = 35;
  protected static final int FIELD_INDEX_SUCCESS_CREATE_LINK_COUNT = 36;
  protected static final int FIELD_INDEX_TOTAL_DELETE_LINK_COUNT = 37;
  protected static final int FIELD_INDEX_SUCCESS_DELETE_LINK_COUNT = 38;
  protected static final int FIELD_INDEX_TOTAL_UPLOAD_BYTES = 39;
  protected static final int FIELD_INDEX_SUCCESS_UPLOAD_BYTES = 40;
  protected static final int FIELD_INDEX_TOTAL_APPEND_BYTES = 41;
  protected static final int FIELD_INDEX_SUCCESS_APPEND_BYTES = 42;
  protected static final int FIELD_INDEX_TOTAL_MODIFY_BYTES = 43;
  protected static final int FIELD_INDEX_SUCCESS_MODIFY_BYTES = 44;
  protected static final int FIELD_INDEX_TOTAL_DOWNLOAD_BYTES = 45;
  protected static final int FIELD_INDEX_SUCCESS_DOWNLOAD_BYTES = 46;
  protected static final int FIELD_INDEX_TOTAL_SYNC_IN_BYTES = 47;
  protected static final int FIELD_INDEX_SUCCESS_SYNC_IN_BYTES = 48;
  protected static final int FIELD_INDEX_TOTAL_SYNC_OUT_BYTES = 49;
  protected static final int FIELD_INDEX_SUCCESS_SYNC_OUT_BYTES = 50;
  protected static final int FIELD_INDEX_TOTAL_FILE_OPEN_COUNT = 51;
  protected static final int FIELD_INDEX_SUCCESS_FILE_OPEN_COUNT = 52;
  protected static final int FIELD_INDEX_TOTAL_FILE_READ_COUNT = 53;
  protected static final int FIELD_INDEX_SUCCESS_FILE_READ_COUNT = 54;
  protected static final int FIELD_INDEX_TOTAL_FILE_WRITE_COUNT = 55;
  protected static final int FIELD_INDEX_SUCCESS_FILE_WRITE_COUNT = 56;
  protected static final int FIELD_INDEX_LAST_SOURCE_UPDATE = 57;
  protected static final int FIELD_INDEX_LAST_SYNC_UPDATE = 58;
  protected static final int FIELD_INDEX_LAST_SYNCED_TIMESTAMP = 59;
  protected static final int FIELD_INDEX_LAST_HEART_BEAT_TIME = 60;
  protected static final int FIELD_INDEX_IF_TRUNK_FILE = 61;
  protected static int fieldsTotalSize;

  protected static FieldInfo[] fieldsArray = new FieldInfo[62];
  protected byte status;
  protected String id;
  protected String ipAddr;
  protected String srcIpAddr;
  protected String domainName;
  protected String version;
  protected long totalMB;
  protected long freeMB;
  protected int uploadPriority;
  protected Date joinTime;
  protected Date upTime;
  protected int storePathCount;
  protected int subdirCountPerPath;
  protected int storagePort;
  protected int storageHttpPort;
  protected int currentWritePath;
  protected int connectionAllocCount;
  protected int connectionCurrentCount;
  protected int connectionMaxCount;
  protected long totalUploadCount;
  protected long successUploadCount;
  protected long totalAppendCount;
  protected long successAppendCount;
  protected long totalModifyCount;
  protected long successModifyCount;
  protected long totalTruncateCount;
  protected long successTruncateCount;
  protected long totalSetMetaCount;
  protected long successSetMetaCount;
  protected long totalDeleteCount;
  protected long successDeleteCount;
  protected long totalDownloadCount;
  protected long successDownloadCount;
  protected long totalGetMetaCount;
  protected long successGetMetaCount;
  protected long totalCreateLinkCount;
  protected long successCreateLinkCount;
  protected long totalDeleteLinkCount;
  protected long successDeleteLinkCount;
  protected long totalUploadBytes;
  protected long successUploadBytes;
  protected long totalAppendBytes;
  protected long successAppendBytes;
  protected long totalModifyBytes;
  protected long successModifyBytes;
  protected long totalDownloadloadBytes;
  protected long successDownloadloadBytes;
  protected long totalSyncInBytes;
  protected long successSyncInBytes;
  protected long totalSyncOutBytes;
  protected long successSyncOutBytes;
  protected long totalFileOpenCount;
  protected long successFileOpenCount;
  protected long totalFileReadCount;
  protected long successFileReadCount;
  protected long totalFileWriteCount;
  protected long successFileWriteCount;
  protected Date lastSourceUpdate;
  protected Date lastSyncUpdate;
  protected Date lastSyncedTimestamp;
  protected Date lastHeartBeatTime;
  protected boolean ifTrunkServer;

  public byte getStatus()
  {
    return this.status;
  }

  public String getId()
  {
    return this.id;
  }

  public String getIpAddr()
  {
    return this.ipAddr;
  }

  public String getSrcIpAddr()
  {
    return this.srcIpAddr;
  }

  public String getDomainName()
  {
    return this.domainName;
  }

  public String getVersion()
  {
    return this.version;
  }

  public long getTotalMB()
  {
    return this.totalMB;
  }

  public long getFreeMB()
  {
    return this.freeMB;
  }

  public int getUploadPriority()
  {
    return this.uploadPriority;
  }

  public Date getJoinTime()
  {
    return this.joinTime;
  }

  public Date getUpTime()
  {
    return this.upTime;
  }

  public int getStorePathCount()
  {
    return this.storePathCount;
  }

  public int getSubdirCountPerPath()
  {
    return this.subdirCountPerPath;
  }

  public int getStoragePort()
  {
    return this.storagePort;
  }

  public int getStorageHttpPort()
  {
    return this.storageHttpPort;
  }

  public int getCurrentWritePath()
  {
    return this.currentWritePath;
  }

  public long getTotalUploadCount()
  {
    return this.totalUploadCount;
  }

  public long getSuccessUploadCount()
  {
    return this.successUploadCount;
  }

  public long getTotalAppendCount()
  {
    return this.totalAppendCount;
  }

  public long getSuccessAppendCount()
  {
    return this.successAppendCount;
  }

  public long getTotalModifyCount()
  {
    return this.totalModifyCount;
  }

  public long getSuccessModifyCount()
  {
    return this.successModifyCount;
  }

  public long getTotalTruncateCount()
  {
    return this.totalTruncateCount;
  }

  public long getSuccessTruncateCount()
  {
    return this.successTruncateCount;
  }

  public long getTotalSetMetaCount()
  {
    return this.totalSetMetaCount;
  }

  public long getSuccessSetMetaCount()
  {
    return this.successSetMetaCount;
  }

  public long getTotalDeleteCount()
  {
    return this.totalDeleteCount;
  }

  public long getSuccessDeleteCount()
  {
    return this.successDeleteCount;
  }

  public long getTotalDownloadCount()
  {
    return this.totalDownloadCount;
  }

  public long getSuccessDownloadCount()
  {
    return this.successDownloadCount;
  }

  public long getTotalGetMetaCount()
  {
    return this.totalGetMetaCount;
  }

  public long getSuccessGetMetaCount()
  {
    return this.successGetMetaCount;
  }

  public long getTotalCreateLinkCount()
  {
    return this.totalCreateLinkCount;
  }

  public long getSuccessCreateLinkCount()
  {
    return this.successCreateLinkCount;
  }

  public long getTotalDeleteLinkCount()
  {
    return this.totalDeleteLinkCount;
  }

  public long getSuccessDeleteLinkCount()
  {
    return this.successDeleteLinkCount;
  }

  public long getTotalUploadBytes()
  {
    return this.totalUploadBytes;
  }

  public long getSuccessUploadBytes()
  {
    return this.successUploadBytes;
  }

  public long getTotalAppendBytes()
  {
    return this.totalAppendBytes;
  }

  public long getSuccessAppendBytes()
  {
    return this.successAppendBytes;
  }

  public long getTotalModifyBytes()
  {
    return this.totalModifyBytes;
  }

  public long getSuccessModifyBytes()
  {
    return this.successModifyBytes;
  }

  public long getTotalDownloadloadBytes()
  {
    return this.totalDownloadloadBytes;
  }

  public long getSuccessDownloadloadBytes()
  {
    return this.successDownloadloadBytes;
  }

  public long getTotalSyncInBytes()
  {
    return this.totalSyncInBytes;
  }

  public long getSuccessSyncInBytes()
  {
    return this.successSyncInBytes;
  }

  public long getTotalSyncOutBytes()
  {
    return this.totalSyncOutBytes;
  }

  public long getSuccessSyncOutBytes()
  {
    return this.successSyncOutBytes;
  }

  public long getTotalFileOpenCount()
  {
    return this.totalFileOpenCount;
  }

  public long getSuccessFileOpenCount()
  {
    return this.successFileOpenCount;
  }

  public long getTotalFileReadCount()
  {
    return this.totalFileReadCount;
  }

  public long getSuccessFileReadCount()
  {
    return this.successFileReadCount;
  }

  public long getTotalFileWriteCount()
  {
    return this.totalFileWriteCount;
  }

  public long getSuccessFileWriteCount()
  {
    return this.successFileWriteCount;
  }

  public Date getLastSourceUpdate()
  {
    return this.lastSourceUpdate;
  }

  public Date getLastSyncUpdate()
  {
    return this.lastSyncUpdate;
  }

  public Date getLastSyncedTimestamp()
  {
    return this.lastSyncedTimestamp;
  }

  public Date getLastHeartBeatTime()
  {
    return this.lastHeartBeatTime;
  }

  public boolean isTrunkServer()
  {
    return this.ifTrunkServer;
  }

  public int getConnectionAllocCount()
  {
    return this.connectionAllocCount;
  }

  public int getConnectionCurrentCount()
  {
    return this.connectionCurrentCount;
  }

  public int getConnectionMaxCount()
  {
    return this.connectionMaxCount;
  }

  public void setFields(byte[] bs, int offset)
  {
    this.status = byteValue(bs, offset, fieldsArray[0]);
    this.id = stringValue(bs, offset, fieldsArray[1]);
    this.ipAddr = stringValue(bs, offset, fieldsArray[2]);
    this.srcIpAddr = stringValue(bs, offset, fieldsArray[4]);
    this.domainName = stringValue(bs, offset, fieldsArray[3]);
    this.version = stringValue(bs, offset, fieldsArray[5]);
    this.totalMB = longValue(bs, offset, fieldsArray[8]);
    this.freeMB = longValue(bs, offset, fieldsArray[9]);
    this.uploadPriority = intValue(bs, offset, fieldsArray[10]);
    this.joinTime = dateValue(bs, offset, fieldsArray[6]);
    this.upTime = dateValue(bs, offset, fieldsArray[7]);
    this.storePathCount = intValue(bs, offset, fieldsArray[11]);
    this.subdirCountPerPath = intValue(bs, offset, fieldsArray[12]);
    this.storagePort = intValue(bs, offset, fieldsArray[14]);
    this.storageHttpPort = intValue(bs, offset, fieldsArray[15]);
    this.currentWritePath = intValue(bs, offset, fieldsArray[13]);

    this.connectionAllocCount = int32Value(bs, offset, fieldsArray[16]);
    this.connectionCurrentCount = int32Value(bs, offset, fieldsArray[17]);
    this.connectionMaxCount = int32Value(bs, offset, fieldsArray[18]);

    this.totalUploadCount = longValue(bs, offset, fieldsArray[19]);
    this.successUploadCount = longValue(bs, offset, fieldsArray[20]);
    this.totalAppendCount = longValue(bs, offset, fieldsArray[21]);
    this.successAppendCount = longValue(bs, offset, fieldsArray[22]);
    this.totalModifyCount = longValue(bs, offset, fieldsArray[23]);
    this.successModifyCount = longValue(bs, offset, fieldsArray[24]);
    this.totalTruncateCount = longValue(bs, offset, fieldsArray[25]);
    this.successTruncateCount = longValue(bs, offset, fieldsArray[26]);
    this.totalSetMetaCount = longValue(bs, offset, fieldsArray[27]);
    this.successSetMetaCount = longValue(bs, offset, fieldsArray[28]);
    this.totalDeleteCount = longValue(bs, offset, fieldsArray[29]);
    this.successDeleteCount = longValue(bs, offset, fieldsArray[30]);
    this.totalDownloadCount = longValue(bs, offset, fieldsArray[31]);
    this.successDownloadCount = longValue(bs, offset, fieldsArray[32]);
    this.totalGetMetaCount = longValue(bs, offset, fieldsArray[33]);
    this.successGetMetaCount = longValue(bs, offset, fieldsArray[34]);
    this.totalCreateLinkCount = longValue(bs, offset, fieldsArray[35]);
    this.successCreateLinkCount = longValue(bs, offset, fieldsArray[36]);
    this.totalDeleteLinkCount = longValue(bs, offset, fieldsArray[37]);
    this.successDeleteLinkCount = longValue(bs, offset, fieldsArray[38]);
    this.totalUploadBytes = longValue(bs, offset, fieldsArray[39]);
    this.successUploadBytes = longValue(bs, offset, fieldsArray[40]);
    this.totalAppendBytes = longValue(bs, offset, fieldsArray[41]);
    this.successAppendBytes = longValue(bs, offset, fieldsArray[42]);
    this.totalModifyBytes = longValue(bs, offset, fieldsArray[43]);
    this.successModifyBytes = longValue(bs, offset, fieldsArray[44]);
    this.totalDownloadloadBytes = longValue(bs, offset, fieldsArray[45]);
    this.successDownloadloadBytes = longValue(bs, offset, fieldsArray[46]);
    this.totalSyncInBytes = longValue(bs, offset, fieldsArray[47]);
    this.successSyncInBytes = longValue(bs, offset, fieldsArray[48]);
    this.totalSyncOutBytes = longValue(bs, offset, fieldsArray[49]);
    this.successSyncOutBytes = longValue(bs, offset, fieldsArray[50]);
    this.totalFileOpenCount = longValue(bs, offset, fieldsArray[51]);
    this.successFileOpenCount = longValue(bs, offset, fieldsArray[52]);
    this.totalFileReadCount = longValue(bs, offset, fieldsArray[53]);
    this.successFileReadCount = longValue(bs, offset, fieldsArray[54]);
    this.totalFileWriteCount = longValue(bs, offset, fieldsArray[55]);
    this.successFileWriteCount = longValue(bs, offset, fieldsArray[56]);
    this.lastSourceUpdate = dateValue(bs, offset, fieldsArray[57]);
    this.lastSyncUpdate = dateValue(bs, offset, fieldsArray[58]);
    this.lastSyncedTimestamp = dateValue(bs, offset, fieldsArray[59]);
    this.lastHeartBeatTime = dateValue(bs, offset, fieldsArray[60]);
    this.ifTrunkServer = booleanValue(bs, offset, fieldsArray[61]);
  }

  public static int getFieldsTotalSize()
  {
    return fieldsTotalSize;
  }

  static
  {
    int offset = 0;

    fieldsArray[0] = new FieldInfo("status", offset, 1);
    offset++;

    fieldsArray[1] = new FieldInfo("id", offset, 16);
    offset += 16;

    fieldsArray[2] = new FieldInfo("ipAddr", offset, 16);
    offset += 16;

    fieldsArray[3] = new FieldInfo("domainName", offset, 128);
    offset += 128;

    fieldsArray[4] = new FieldInfo("srcIpAddr", offset, 16);
    offset += 16;

    fieldsArray[5] = new FieldInfo("version", offset, 6);
    offset += 6;

    fieldsArray[6] = new FieldInfo("joinTime", offset, 8);
    offset += 8;

    fieldsArray[7] = new FieldInfo("upTime", offset, 8);
    offset += 8;

    fieldsArray[8] = new FieldInfo("totalMB", offset, 8);
    offset += 8;

    fieldsArray[9] = new FieldInfo("freeMB", offset, 8);
    offset += 8;

    fieldsArray[10] = new FieldInfo("uploadPriority", offset, 8);
    offset += 8;

    fieldsArray[11] = new FieldInfo("storePathCount", offset, 8);
    offset += 8;

    fieldsArray[12] = new FieldInfo("subdirCountPerPath", offset, 8);
    offset += 8;

    fieldsArray[13] = new FieldInfo("currentWritePath", offset, 8);
    offset += 8;

    fieldsArray[14] = new FieldInfo("storagePort", offset, 8);
    offset += 8;

    fieldsArray[15] = new FieldInfo("storageHttpPort", offset, 8);
    offset += 8;

    fieldsArray[16] = new FieldInfo("connectionAllocCount", offset, 4);
    offset += 4;

    fieldsArray[17] = new FieldInfo("connectionCurrentCount", offset, 4);
    offset += 4;

    fieldsArray[18] = new FieldInfo("connectionMaxCount", offset, 4);
    offset += 4;

    fieldsArray[19] = new FieldInfo("totalUploadCount", offset, 8);
    offset += 8;

    fieldsArray[20] = new FieldInfo("successUploadCount", offset, 8);
    offset += 8;

    fieldsArray[21] = new FieldInfo("totalAppendCount", offset, 8);
    offset += 8;

    fieldsArray[22] = new FieldInfo("successAppendCount", offset, 8);
    offset += 8;

    fieldsArray[23] = new FieldInfo("totalModifyCount", offset, 8);
    offset += 8;

    fieldsArray[24] = new FieldInfo("successModifyCount", offset, 8);
    offset += 8;

    fieldsArray[25] = new FieldInfo("totalTruncateCount", offset, 8);
    offset += 8;

    fieldsArray[26] = new FieldInfo("successTruncateCount", offset, 8);
    offset += 8;

    fieldsArray[27] = new FieldInfo("totalSetMetaCount", offset, 8);
    offset += 8;

    fieldsArray[28] = new FieldInfo("successSetMetaCount", offset, 8);
    offset += 8;

    fieldsArray[29] = new FieldInfo("totalDeleteCount", offset, 8);
    offset += 8;

    fieldsArray[30] = new FieldInfo("successDeleteCount", offset, 8);
    offset += 8;

    fieldsArray[31] = new FieldInfo("totalDownloadCount", offset, 8);
    offset += 8;

    fieldsArray[32] = new FieldInfo("successDownloadCount", offset, 8);
    offset += 8;

    fieldsArray[33] = new FieldInfo("totalGetMetaCount", offset, 8);
    offset += 8;

    fieldsArray[34] = new FieldInfo("successGetMetaCount", offset, 8);
    offset += 8;

    fieldsArray[35] = new FieldInfo("totalCreateLinkCount", offset, 8);
    offset += 8;

    fieldsArray[36] = new FieldInfo("successCreateLinkCount", offset, 8);
    offset += 8;

    fieldsArray[37] = new FieldInfo("totalDeleteLinkCount", offset, 8);
    offset += 8;

    fieldsArray[38] = new FieldInfo("successDeleteLinkCount", offset, 8);
    offset += 8;

    fieldsArray[39] = new FieldInfo("totalUploadBytes", offset, 8);
    offset += 8;

    fieldsArray[40] = new FieldInfo("successUploadBytes", offset, 8);
    offset += 8;

    fieldsArray[41] = new FieldInfo("totalAppendBytes", offset, 8);
    offset += 8;

    fieldsArray[42] = new FieldInfo("successAppendBytes", offset, 8);
    offset += 8;

    fieldsArray[43] = new FieldInfo("totalModifyBytes", offset, 8);
    offset += 8;

    fieldsArray[44] = new FieldInfo("successModifyBytes", offset, 8);
    offset += 8;

    fieldsArray[45] = new FieldInfo("totalDownloadloadBytes", offset, 8);
    offset += 8;

    fieldsArray[46] = new FieldInfo("successDownloadloadBytes", offset, 8);
    offset += 8;

    fieldsArray[47] = new FieldInfo("totalSyncInBytes", offset, 8);
    offset += 8;

    fieldsArray[48] = new FieldInfo("successSyncInBytes", offset, 8);
    offset += 8;

    fieldsArray[49] = new FieldInfo("totalSyncOutBytes", offset, 8);
    offset += 8;

    fieldsArray[50] = new FieldInfo("successSyncOutBytes", offset, 8);
    offset += 8;

    fieldsArray[51] = new FieldInfo("totalFileOpenCount", offset, 8);
    offset += 8;

    fieldsArray[52] = new FieldInfo("successFileOpenCount", offset, 8);
    offset += 8;

    fieldsArray[53] = new FieldInfo("totalFileReadCount", offset, 8);
    offset += 8;

    fieldsArray[54] = new FieldInfo("successFileReadCount", offset, 8);
    offset += 8;

    fieldsArray[55] = new FieldInfo("totalFileWriteCount", offset, 8);
    offset += 8;

    fieldsArray[56] = new FieldInfo("successFileWriteCount", offset, 8);
    offset += 8;

    fieldsArray[57] = new FieldInfo("lastSourceUpdate", offset, 8);
    offset += 8;

    fieldsArray[58] = new FieldInfo("lastSyncUpdate", offset, 8);
    offset += 8;

    fieldsArray[59] = new FieldInfo("lastSyncedTimestamp", offset, 8);
    offset += 8;

    fieldsArray[60] = new FieldInfo("lastHeartBeatTime", offset, 8);
    offset += 8;

    fieldsArray[61] = new FieldInfo("ifTrunkServer", offset, 1);
    offset++;
  }
}